package com.douxg.learning.bigdata.solr;

import org.apache.solr.client.solrj.impl.CloudSolrClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName SolrConfig
 * @Description TODO
 * @Author douxg
 * @Date 2020/2/17 16:55
 * @Version 1.0
 */
@Configuration
//@EnableSolrRepositories
public class SolrConfig {
    @Value("${solr.zkUrl:192.168.12.52:2181}")
    private String zkUrl;

    @Bean
    public CloudSolrClient getCloudSolrClient() {

        return new CloudSolrClient(zkUrl);
    }
}
